import os
import unittest

import yagmail
from HTMLTestRunner import HTMLTestRunner

tests = unittest.defaultTestLoader.discover(os.getcwd())
report = HTMLTestRunner.HTMLTestRunner(
    stream=open('report.html', mode='w+', encoding='utf-8')
)
report.run(tests)

yag = yagmail.SMTP(
    user='2153255197@qq.com',
    password='uisiiayojifhdjjg',
    host='smtp.qq.com'
)
yag.send('2153255197@qq.com', 'report', '111', 'E:\gitee\自动化测试-修改\\report.html')
